<?php

namespace App\Http\Controllers\Component;

use App\Http\Controllers\CommonController;
use App\Models\Area;
use App\Models\MemberWechat;
use App\Models\MemberWexinQrcode;
use EasyWeChat\OfficialAccount\Application;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class ComponentController extends CommonController
{
    /**
     * 获取城市列表
     *
     * @param Request $request
     * @param int $city_id
     * @return mixed
     */
    public function citylist(Request $request, $city_id = 0)
    {
        $city_list = Area::where('parent_id', $city_id)->selectRaw('area_id as id,area_name as name')->orderBy('listorder', 'asc')->get();
        return $this->success('success', ['citylist' => $city_list]);
    }
    /**
     * 地图获取经纬度
     *
     * @param Request $request
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
     */
    public function getaddress(Request $request)
    {
        return $this->display('component.address_1');
    }
}
